#include "display.h"


DISP_struct disp;

#ifdef SEGLCD
void Symbols(uint8_t sym)
{
	switch (sym)
	{
	case StopLine:
		Ht1621WrOneData(17, 0x02+0x04);  // 停 + 线
		break;
	case ModePulse:  
		Ht1621WrOneData(12, 0x01); 		 // 计量
		break;
	case ModeTime:  
		Ht1621WrOneData(11, 0x01);  	 // 计时
		break;
	case Exclama:  
		Ht1621WrOneData(18, 0x01);  	 // !!!
		break;
	case okLine:  
		Ht1621WrOneData(17, 0x01);       // -- ok --
		break;
	case ModeTimeYuan:  
		Ht1621WrOneData(11, 0x01+0x08);  // 计时 + 元
		break;
	case NumLine:  
		Ht1621WrOneData(17, 0x04);       // ?????
		break;
	case SMoney:
		Ht1621WrOneData(18, 0x08);      // 金额
		break;
	case ModePulseYuan:  
		Ht1621WrOneData(12, 0x01); 		 // 计量 + 元
		Ht1621WrOneData(11, 0x08); 		 // ?
		break;
	case Yuan:  
		Ht1621WrOneData(11, 0x08); 		 // 元
		break;
	case Limit:  
		Ht1621WrOneData(12, 0x02); 		 // 限量
		break;
	case Litre:  
		Ht1621WrOneData(12, 0x08); 		 // 升
		break;
	case LimitFullYuan:  
		Ht1621WrOneData(12, 0x02); 		 // 限量 元 满
		Ht1621WrOneData(11, 0x08+0x02);
		break;
	case Error:  
		Ht1621WrOneData(17,0x08); 		 // 错误
		break;
	case MoneyExclama:
		Ht1621WrOneData(18, 0x09);      // 金额 !!!
		break;
	default:
		break;
	}
}
#endif

void Disp_Init(void)
{
#ifdef SEGLCD
	InitSegLCD();

	disp.Clear = LCD.Clear;
	disp.Sector = ShowSector;
	disp.Clock = LCD.ShowClock;
	disp.ErrorCode = LCD.ShowErrorCode;
	disp.Symbols = Symbols;
	disp.WriteMulDig = LCD.WriteMulDig;
	disp.ClearFewDigi = LCD.ClearNum;
	disp.LcdData = Ht1621WrOneData;
	disp.OneNum = Ht1621_DisplayNum;
	disp.DisTiming = DispTiming;
	disp.Complete = LCD.ShowOver;
	disp.TimeOut = LCD.ShowTimeOut;
	disp.Balance = ShowBalance;
    disp.AuthCode = LCD.ShowAuthCode;
	disp.Liter = LCD.ShowLiter;
	disp.sIP = LCD.ShowIP;
	disp.sHEX = ShowHex;
	disp.segDash = Ht1621ShowDash;
	disp.TotalConsum = ShowTotalConsum;
	disp.PlusFee = ShowPlusFee;
	disp.Backlight = LCD.SetLight;
	disp.ShowVersion = LCD.ShowVersion;

	disp.ShowVersion(11124);   //版本号+年
#elif defined (DIGLED)
	Init_DigLED();

	disp.Clear = DLED.Clear;
	disp.Sector = DigLED_ShowSector;
	disp.Clock = DigLED_ShowClock;
	disp.ErrorCode = DLED.ShowErrorCode;
	disp.Complete = DLED.Complete;
	disp.OneNum = DLED.WriteNum;
	disp.sIP = DLED.ShowIP;
	disp.segDash = DigLED_ShowSegDash;
	disp.AuthCode = DLED.ShowAuthCode;
	disp.WriteMulDig = DigLED_WriteMulDig;
	disp.TotalConsum = DigLED_ShowTotalConsum;
	disp.Balance = DigLED_ShowBalance;
	disp.PlusFee = DigLED_ShowPlusFee;
	disp.WriteSame = DigLED_WriteSame;
	disp.Complete = DLED.Complete;
	disp.TimeOut = DigLED_TimeOut;
	disp.DisTiming = DigLED_DispTiming;
	disp.Liter = DigLED_ShowLiter;
	disp.ShowVersion = DigLED_ShowVers;
    disp.ShowString  = DigLED_ShowString;

    disp.ShowVersion(11024);   //?????
#endif
}



